﻿using Abp.Application.Services;
using AbpZeroTemplate.Sessions;
using AbpZeroTemplate.Sessions.Dto;
using AbpZeroTemplate.Web.Controllers;
using AbpZeroTemplate.Web.Swagger;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace AbpZeroTemplate.Api.Admin.Controllers
{
    /// <summary>获取Session信息
    /// </summary>
    [Area("Admin")]
    [Route("Admin/Session/[action]")]
    [ApiName("Admin")]
    [RemoteService]
    public class SessionController : AbpZeroTemplateControllerBase
    {
        private ISessionAppService _sessionAppService;
        /// <summary>
        /// </summary>
        public SessionController(ISessionAppService sessionAppService)
        {
            _sessionAppService = sessionAppService;
        }

        /// <summary>获取当前登录信息
        /// </summary>
        [HttpGet]
        public async Task<GetCurrentLoginInformationsOutput> GetCurrentLoginInformations()
        {
            return await _sessionAppService.GetCurrentLoginInformations();
        }
    }
}
